package cn.bonoon.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;

import cn.bonoon.kernel.support.entities.BaseEntity;
import cn.bonoon.kernel.support.entities.EntityStatus;

/**
 * 账号、用户组、角色、服务器等的策略
 * 策略包括内容：
 * 1. 有效期
 * 2. 定期开放
 * 3. 定期关闭
 * 4. 限制访问
 * 5. 单次有效
 * 
 * 如：系统定期维护策略，如果设定这个策略，则到指定的时间，所有访问系统的连接都被重定向到指定的提示界面
 * 
 * @author jackson
 *
 */
@Entity
@Table(name = "t_strategy")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class StrategyEntity extends BaseEntity implements EntityStatus{

	private static final long serialVersionUID = 1976232467549028312L;
	
	@Column(name = "C_STATUS")
	private int status;
	
	/** 策略是否有效 */
	@Column(name = "C_INVALID")
	private boolean invalid;

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public boolean isInvalid() {
		return invalid;
	}

	public void setInvalid(boolean invalid) {
		this.invalid = invalid;
	}

}
